/******************************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Ltd.                       */
/*                                                                            */
/*  NAME      = informix_sql_type.h                                             */
/*  NOTE      =                                                               */
/*  DATE      = 2015/08/26 by zhengxd                                         */
/******************************************************************************/
#ifndef _INFORMIX_SQL_TYPE_H_
#define _INFORMIX_SQL_TYPE_H_

#include "informix_core.h"

#define INFORMIX_TYPE_CHAR            0
#define INFORMIX_TYPE_SMALLINT        1
#define INFORMIX_TYPE_INT             2
#define INFORMIX_TYPE_FLOAT           3
#define INFORMIX_TYPE_SMFLOAT         4
#define INFORMIX_TYPE_DECIMAL         5
#define INFORMIX_TYPE_SERIAL          6
#define INFORMIX_TYPE_DATE            7
#define INFORMIX_TYPE_MONEY           8
#define INFORMIX_TYPE_NULL            9
#define INFORMIX_TYPE_DATETIME        10
#define INFORMIX_TYPE_BYTE            11
#define INFORMIX_TYPE_TEXT            12
#define INFORMIX_TYPE_VARCHAR         13
#define INFORMIX_TYPE_INTERVAL        14
#define INFORMIX_TYPE_NCHAR           15
#define INFORMIX_TYPE_NVCHAR          16
#define INFORMIX_TYPE_INT8            17
#define INFORMIX_TYPE_SERIAL8         18
#define INFORMIX_TYPE_SET             19
#define INFORMIX_TYPE_MULTISET        20
#define INFORMIX_TYPE_LIST            21
#define INFORMIX_TYPE_ROW             22
#define INFORMIX_TYPE_COLLECTION      23
#define INFORMIX_TYPE_ROWREF          24
#define INFORMIX_TYPE_UDTVAR          40
#define INFORMIX_TYPE_UDTFIXED        41
#define INFORMIX_TYPE_REFSER8         42
#define INFORMIX_TYPE_LVARCHAR        43
#define INFORMIX_TYPE_SENDRECV        44
#define INFORMIX_TYPE_BOOL            45
#define INFORMIX_TYPE_IMPEXP          46
#define INFORMIX_TYPE_IMPEXPBIN       47
#define INFORMIX_TYPE_SQLUDRDEFAULT   48
#define INFORMIX_TYPE_UNKNOWN         49
#define INFORMIX_TYPE_MAX             50
#define INFORMIX_TYPE_CLOB            101
#define INFORMIX_TYPE_BLOB            102
#define INFORMIX_TYPE_BIGINT          52
#define INFORMIX_TYPE_BIGSERIAL       53

int informix_convert_to_boolean(Frbyte_Packet *p_st_data
                                , int i_null_flg
                                , Frdata_field **pp_st_value);

int informix_convert_to_int(Frbyte_Packet *p_st_data
                            , int i_null_flg
                            , unsigned int ui_int_len
                            , int i_unsigned_flg
                            , Frdata_field **pp_st_value);

int informix_convert_to_float(Frbyte_Packet *p_st_data
                              , int i_null_flg
                              , unsigned int ui_float_len
                              , int i_float_type
                              , Frdata_field **pp_st_value);

int informix_convert_to_str(Frbyte_Packet *p_st_data
                            , int i_null_flg
                            , unsigned int ui_len_bytes
                            , Frdata_field **pp_st_value);

int informix_convert_to_date(Frbyte_Packet *p_st_data
                             , int i_null_flg
                             , Frdata_field **pp_st_value);

int informix_convert_to_datetime(Frbyte_Packet *p_st_data
                                 , int i_null_flg
                                 , Frdata_field **pp_st_value);

int informix_convert_to_decimal(Frbyte_Packet *p_st_data
                                , int i_null_flg
                                , Frdata_field **pp_st_value);

int informix_convert_to_large(Frbyte_Packet *p_st_data
                             , int i_null_flg
                             , char *p_value
                             , Frdata_field **pp_st_value);

int informix_convert_to_lob(Frbyte_Packet *p_st_data
                           , int i_null_flg
                           , Frdata_field **pp_st_value);

#endif
